﻿using SqlSugar;
using System;
using System.Collections.Generic;

namespace Rf.Support.Model.Models
{
    /// <summary>
    /// 路由菜单表
    /// </summary>
    public class Permission : PermissionRoot<long>
    {


        /// <summary>
        /// 路由地址
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string Code { get; set; }
        /// <summary>
        /// 菜单显示名（如用户页、编辑(按钮)、删除(按钮)）
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string Name { get; set; }
        /// <summary>
        /// 是否是按钮
        /// </summary>
        public bool IsButton { get; set; } = false;
        /// <summary>
        /// 是否是隐藏菜单
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? IsHide { get; set; } = false;
        /// <summary>
        /// 是否keepAlive
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? IskeepAlive { get; set; } = false;


        /// <summary>
        /// 按钮事件(按钮编码)
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true)]
        public string Func { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int OrderSort { get; set; }
        /// <summary>
        /// 菜单图标
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true)]
        public string Icon { get; set; }
        /// <summary>
        /// 菜单描述    
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true)]
        public string Description { get; set; }
        /// <summary>
        /// 激活状态
        /// </summary>
        public bool Enabled { get; set; }
        /// <summary>
        /// 创建ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public long? CreateId { get; set; }
        /// <summary>
        /// 创建者
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string CreateBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 修改ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public long? ModifyId { get; set; }
        /// <summary>
        /// 修改者
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string ModifyBy { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ModifyTime { get; set; } = DateTime.Now;

        /// <summary>
        ///获取或设置是否禁用，逻辑上的删除，非物理删除
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? IsDeleted { get; set; }

        /// <summary>
        /// 组装菜单的完整名称（["根节点/", "部门权限管理/", "部门管理/"]）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<string> PnameArr { get; set; } = new List<string>();

        [SugarColumn(IsIgnore = true)]
        public string MName { get; set; }

        /// <summary>
        /// 是否还有子节点
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool hasChildren { get; set; } = true;
        /// <summary>
        /// 子节点
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<Permission> Children { get; set; } = new List<Permission>();
        /// <summary>
        /// 接口
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Interface Interface { get; set; }
        /// <summary>
        /// 模块Id
        /// </summary>
        public long? ModuleId { get; set; }


    }
}
